const joi = require('joi')


// 定义newsId的验证规则
const activityId = joi.number().integer().min(1).required()
// 定义typeId验证规则
const typeId = joi.number().integer().min(1).required()
// 定义newsTitle验证规则
const activityTitle = joi.string().required()
// 定义newsContent验证规则
const activityContent = joi.string().required()
const activityAdress = joi.string().required()
// 定义时间查找规则

const pub_date = joi.date().timestamp()
const now = Date.now()
const nowDate = new Date(now)


// 添加数据
exports.add_activity_schema = {
    body:{
        activityTitle,
        activityContent,
        activityAdress
    }
}
// 校验删除
exports.delete_activity_schema={
    params:{
        activityId
    }
}
// 验证提交的数据是否合法
exports.update_activity_schema={
    body:{
        activityId,
        typeId,
        activityTitle,
        activityContent
    }
}
// 查询
exports.get_news_schema={
    params:{
        activityId
    }
}